package com.rr.easy;

import java.util.Arrays;
import java.util.Date;
import java.util.Scanner;

/**
 * @author RR
 * @date 2022/10/9 15:38
 */
public class ScannerTest {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int num = scanner.nextInt();
        int speed = scanner.nextInt();
        int[] array = new int[num];
        for (int i = 0; i < num; i++) {
            int i1 = scanner.hasNextInt() ? scanner.nextInt() : 0;
            int i2 = scanner.hasNextInt() ? scanner.nextInt() : 0;
            array[i] = i1 + i2;
        }
        Arrays.sort(array);
        System.out.println(Arrays.toString(array));
        int ans = 0;
        int canNotGetIt = 0;
        for (int i : array) {
            if (canNotGetIt >= i) {
                ans++;
                canNotGetIt = i + speed;
            }
        }
        System.out.println(ans);
    }
}
